﻿// Author: Iulian Lita
// Project: UsersModule.AdminActions
// Path: C:\Users\Tym\Documents\Visual Studio 2008\Projects\Library\UsersModule.AdminActions
// Creation date: 1/13/2009 2:42 PM
// Last modified: 1/14/2009 2:25 AM

#region Using directives
using DatabaseModule;
using Error;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion

namespace UsersModule.AdminActions
{
    /// <summary>
    /// Admin
    /// </summary>
    public class DefaultAdminActions
    {
        /// <summary>
        /// Penalize user
        /// </summary>
        /// <param name="id">Id</param>
        public bool PenalizeUser(int username)
        {
            try
            {
                DatabaseWork dw = new DatabaseWork();
                dw.UpdateUserPenalized(1, username);
                dw.Dispose();
            }
            catch (Exception exc)
            {
                ErrorManagement.ManageException(exc);
                return false;
            }
            return true;
        } // PenalizeUser(username)

        /// <summary>
        /// Pay
        /// </summary>
        /// <param name="username">Username</param>
        public bool Pay(int username)
        {
            try
            {
                DatabaseWork dw = new DatabaseWork();
                dw.UpdateUserPenalized(0, username);
                dw.Dispose();
            }
            catch (Exception exc)
            {
                ErrorManagement.ManageException(exc);
                return false;
            }
            return true;
        } // Pay(username)
    } // class DefaultAdminActions
} // namespace UsersModule.AdminActions
